﻿using ENail.Domain.Core;
using Equation.Enterprise.Framework.Domain.Model;

namespace ENail.Domain.Data.Mapping
{
    public class AssignmentMapping : EntityMapping<Assignment>
    {
        public AssignmentMapping() : base("Assignment")
        {
            Property(x => x.Id).HasColumnName("AssignmentId");
            HasRequired(x => x.Registration).WithMany(x => x.Assignments).Map(x => x.MapKey("RegistrationId"));
            HasRequired(x => x.Employee).WithMany().Map(x=>x.MapKey("EmployeeId"));
            HasRequired(x => x.NailService).WithMany().Map(x=>x.MapKey("NailServiceId"));
        }
    }
}
